Skip to content

Commit

Permalink
teach build system & rtapi about RTAI 5
Browse files Browse the repository at this point in the history
RTAI 5 (which has not been released yet) introduces changes (possibly
unintentional) to the API.  This commit updates rtapi to use the
current API.

Signed-off-by: Sebastian Kuzminsky <seb@highlab.com>
  • Loading branch information
SebKuzminsky committed Dec 27, 2015
1 parent d6da65f commit aa39754
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
6 changes: 6 additions & 0 deletions scripts/rtapi.conf.in
Expand Up @@ -28,4 +28,10 @@ if [ "@RTAI@" = "3" ] ; then \
MODPATH_rtai_fifos=@MODPATH_rtai_fifos@
MODPATH_rtai_sem=@MODPATH_rtai_sem@
MODPATH_rtai_math=@MODPATH_rtai_math@
elif [ "@RTAI@" = "5" ] ; then \
MODULES="rtai_hal rtai_sched rtai_math"
RTAI=@RTAI@
MODPATH_rtai_hal=@MODPATH_rtai_hal@
MODPATH_rtai_sched=@MODPATH_rtai_sched@
MODPATH_rtai_math=@MODPATH_rtai_math@
fi
8 changes: 5 additions & 3 deletions src/configure.in
Expand Up @@ -287,11 +287,12 @@ case $RTS in
*/rtai-config)
RTNAME=rtai-3.0
RTPREFIX=rtai
RTAI=3
RTAI_VERSION=$($RTS --version)
RTAI=$(echo $RTAI_VERSION | cut -f 1 -d .)
RTDIR=`$RTS --prefix`
RTDIR=$(cd $RTDIR ; pwd -P )
RTFLAGS=`$RTS --module-cflags`
RTFLAGS="$RTFLAGS -DRTAI=3"
RTFLAGS="$RTFLAGS -DRTAI=$RTAI"
KERNELDIR=`$RTS --linux-dir`
RTARCH=`$RTS --arch`
ULAPI_CFLAGS=`$RTS --lxrt-cflags`
Expand Down Expand Up @@ -1077,7 +1078,7 @@ AC_SUBST(BUILD_DOCS_HTML)

if test $RTS '!=' uspace
then
for m in adeos rtai_hal rtai_ksched rtai_fifos rtai_sem rtai_math \
for m in adeos rtai_hal rtai_ksched rtai_sched rtai_fifos rtai_sem rtai_math \
; do
AC_MSG_CHECKING([for $m])
TMP=$(find $MODULE_DIR -name $m$MODEXT 2>/dev/null)
Expand All @@ -1091,6 +1092,7 @@ done
AC_SUBST(MODPATH_adeos)
AC_SUBST(MODPATH_rtai_hal)
AC_SUBST(MODPATH_rtai_ksched)
AC_SUBST(MODPATH_rtai_sched)
AC_SUBST(MODPATH_rtai_fifos)
AC_SUBST(MODPATH_rtai_sem)
AC_SUBST(MODPATH_rtai_math)
Expand Down
10 changes: 7 additions & 3 deletions src/rtapi/rtai_rtapi.c
Expand Up @@ -89,6 +89,10 @@
#define RTAI_NR_TRAPS HAL_NR_FAULTS
#endif

#if RTAI <= 3
#define rt_free_timers rt_free_timer
#endif

/* resource data unique to kernel space */
static RT_TASK *ostask_array[RTAPI_MAX_TASKS + 1];
static void *shmem_addr_array[RTAPI_MAX_SHMEMS + 1];
Expand Down Expand Up @@ -257,7 +261,7 @@ void cleanup_module(void)
}
if (rtapi_data->timer_running != 0) {
stop_rt_timer();
rt_free_timer();
rt_free_timers();
rtapi_data->timer_period = 0;
timer_counts = 0;
rtapi_data->timer_running = 0;
Expand Down Expand Up @@ -402,7 +406,7 @@ static int module_delete(int module_id)
if (rtapi_data->rt_module_count == 0) {
if (rtapi_data->timer_running != 0) {
stop_rt_timer();
rt_free_timer();
rt_free_timers();
rtapi_data->timer_period = 0;
timer_counts = 0;
max_delay = DEFAULT_MAX_DELAY;
Expand Down Expand Up @@ -759,7 +763,7 @@ static int task_delete(int task_id)
if (rtapi_data->task_count == 0) {
if (rtapi_data->timer_running != 0) {
stop_rt_timer();
rt_free_timer();
rt_free_timers();
rtapi_data->timer_period = 0;
max_delay = DEFAULT_MAX_DELAY;
rtapi_data->timer_running = 0;
Expand Down

0 comments on commit aa39754

Please sign in to comment.